/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.bigstorage.entity;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.NotBlank;
import org.hibernate.validator.constraints.Length;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 分类表Entity
 * @author zhuqingya
 * @version 2019-12-13
 */
@Table(name="biz_category", alias="a", columns={
		@Column(name="id", attrName="id", label="唯一标识", isPK=true),
		@Column(name="sort", attrName="sort", label="顺序"),
		@Column(name="thumbnail", attrName="thumbnail", label="缩略图"),
		@Column(name="name", attrName="name", label="名称", queryType=QueryType.LIKE),
		@Column(name="create_by", attrName="createBy", label="创建者", isUpdate=false, isQuery=false),
		@Column(name="create_date", attrName="createDate", label="创建时间", isUpdate=false, isQuery=false),
		@Column(name="update_by", attrName="updateBy", label="更新者", isUpdate=false, isQuery=false),
		@Column(name="update_date", attrName="updateDate", label="更新时间", isUpdate=false, isQuery=false),
	}, orderBy="a.update_date DESC"
)
public class Category extends DataEntity<Category> {
	
	private static final long serialVersionUID = 1L;
	private Long sort;		// 顺序
	private String thumbnail;		// 缩略图
	private String name;		// 名称
	
	public Category() {
		this(null);
	}

	public Category(String id){
		super(id);
	}
	
	@NotNull(message="顺序不能为空")
	public Long getSort() {
		return sort;
	}

	public void setSort(Long sort) {
		this.sort = sort;
	}
	
	@NotBlank(message="缩略图不能为空")
	@Length(min=0, max=255, message="缩略图长度不能超过 255 个字符")
	public String getThumbnail() {
		return thumbnail;
	}

	public void setThumbnail(String thumbnail) {
		this.thumbnail = thumbnail;
	}
	
	@NotBlank(message="名称不能为空")
	@Length(min=0, max=255, message="名称长度不能超过 255 个字符")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
}